<?php
namespace Home\Controller;
use Home\Controller\BaseController;
class IndexController extends BaseController {
	public function _initialize(){
	}
    public function index(){
	 //获取分类信息
	  $sql="select * from yjl_classify";
	  $resc=M()->query($sql);
	  for($i=0;$i<count($resc);$i++)
	  {
		  $sql="select * from yjl_goods where yjl_classid=".$resc[$i]['yjl_id']." order by yjl_id desc limit 0,4 ";
		  $resg[$i]['det']=M()->query($sql);
		  $resg[$i]['classname']=$resc[$i]['yjl_classname'];
		  $resg[$i]['classid']=$resc[$i]['yjl_id'];
	  }
	  $this->assign("list_goods",$resg);
	   $this->display();
    }	
	public function register(){
		parent::add("users","yjl_photo");
	}
	 
}